<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5shiv.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->

<link href="/Public/Admin/static/h-ui/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="/Public/Admin/static/h-ui.admin/css/H-ui.login.css" rel="stylesheet" type="text/css" />
<link href="/Public/Admin/static/h-ui.admin/css/style.css" rel="stylesheet" type="text/css" />
<link href="/Public/Admin/lib/Hui-iconfont/1.0.8/iconfont.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/static/h-ui.admin/skin/default/skin.css" id="skin" />

<script type="text/javascript" src="/Public/Admin/lib/jquery/1.9.1/jquery.min.js"></script> 

<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title></title>
<meta name="keywords" content="H-ui.admin v3.1,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载">
<meta name="description" content="H-ui.admin v3.1，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">
</head>
<body>
	
<link href="/Public/Admin/kindeditor/themes/default/default.css" rel="stylesheet" />
<article class="page-container">
	<article class="page-container">
	<form method="post" action="<?php echo U('addBlog');?>" class="form form-horizontal" id="form-article-add">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">博客栏目：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" readonly class="input-text" value="<?php echo ($cat_name); ?>" placeholder="" id="sources" name="source">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>文章标题：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="<?php echo ($blog['title']); ?>" placeholder="" id="articletitle" name="title">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>关键字：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" placeholder="请用英文逗号隔开" class="input-text" value="<?php echo getKeyWords($_GET['blog_id']);?>" placeholder="" id="articletitle" name="keywords">
			</div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">文章来源：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="<?php echo ($blog['source']); ?>" placeholder="" id="sources" name="source">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">文章摘要：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<textarea class="textarea valid" name="description" aria-required="true" id="textarea" aria-invalid="false"><?php echo ($blog['description']); ?></textarea>
			</div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">个人推荐：</label>
			<div class="formControls col-xs-8 col-sm-2 skin-minimal">
				<div class="check-box">
					<input type="checkbox" id="checkbox-moban" <?php if($blog["is_commont"]==1): ?>checked<?php endif; ?> name="is_commont" value="1">
					<label for="checkbox-moban">&nbsp;</label>
				</div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">图片上传：</label>
			
			<div class="formControls col-xs-8 col-sm-2 skin-minimal">
				<input type="button" value="上传" id="chooseImage" />
				<img id="imgbox" style="max-height: 150px;max-width: 220px;" src="<?php if(!empty($blog["theme"])): echo ($blog['theme']); else: ?>/Public/Admin/timg.jpg<?php endif; ?>"/>
			</div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">博客发布时间：</label>
			<div class="formControls col-xs-8 col-sm-2">
				<input name="time" type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" id="datemin" readonly value="<?php if(empty($blog)): echo date('Y-m-d H:i:s',$time); else: echo date('Y-m-d H:i:s',$blog['time']); endif; ?>" class="input-text Wdate" style="width:180px;">
			</div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">文章内容：</label>
			<div class="formControls col-xs-8 col-sm-9"> 
				<script name='content' id="editor" type="text/plain" style="width:100%;height:400px;"><?php echo ($blog['content']); ?></script> 
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<input type='hidden' name='cat_id' value='<?php echo ($_GET['id']); ?>' />
				<input type='hidden' name='id' value='<?php if(empty($_GET['blog_id'])): ?>0<?php else: echo ($_GET['blog_id']); endif; ?>' />
				<button class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 提交</button>
			</div>
		</div>
		<input type="hidden" name="theme" value="">
		<input type="hidden" id="oldImage" value="">
	</form>
</article>
<script src="/Public/Admin/kindeditor/kindeditor-all-min.js"></script>
<script src="/Public/Admin/kindeditor/lang/zh-CN.js"></script>
<script type="text/javascript">

$(function(){
	$("#textarea").Huitextarealength({minlength:0,maxlength:200});
})


    KindEditor.ready(function (K) {
        var editor = K.editor({
            uploadJson: '<?php echo U('Base/uploadImage',array('theme'=>1));?>',
             allowFileManager: true,
         });

         K('#chooseImage').click(function () {
             editor.loadPlugin('image', function () {
                 editor.plugin.imageDialog({
                    showRemote: false,
                     imageUrl: K('#PicUrl').val(),
                     clickFn: function (url, message, error) {
                         layer.msg('上传成功',{icon:6,time:500});
                         K("#imgbox").attr("src", url.split('|')[0]);
                         $("input[name=theme]").val(url);
                         editor.hideDialog();
                     }
                 });
             });
         });
    });
 </script>
 
<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	$("#form-article-add").validate({
		rules:{
			title:{
				required:true,
				minlength:2,
				maxlength:100
			},
			
		},
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		
	});
	var ue = UE.getEditor('editor');
	
});

</script>


	
<script type="text/javascript" src="/Public/Admin/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="/Public/Admin/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/Public/Admin/static/h-ui.admin/js/H-ui.admin.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/My97DatePicker/4.8/WdatePicker.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/datatables/1.10.0/jquery.dataTables.min.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="/Public/Admin/lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/jquery.validation/1.14.0/messages_zh.js"></script>

<script type="text/javascript" src="/Public/Admin/lib/webuploader/0.1.5/webuploader.min.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/ueditor/1.4.3/ueditor.config.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/ueditor/1.4.3/ueditor.all.min.js"> </script> 
<script type="text/javascript" src="/Public/Admin/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="/Public/Admin/lib/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
</body>
</html>